#include "pch.h"

#include "math/vector4.h"
#include "core/config.h"

#ifdef RE_USE_DX


namespace Math
{

	///
	vector4::vector4():
float4(0.0f,0.0f,0.0f,0.0f)
{

}


///
vector4::vector4(scalar x, scalar y, scalar z, scalar w):
float4(x,y,z,w)
{

}


///
vector4::vector4(const float4 & rhs):
float4(rhs)
{

}





///
void vector4::operator = (const vector4 & rhs)
{
	this->m_vec = rhs.m_vec;
}


///
bool vector4::operator ==(const Math::vector4 &rhs) const
{
	return (0 != XMVector4Equal(this->m_vec, rhs.m_vec));
}


///
bool vector4::operator !=(const Math::vector4 & rhs) const 
{
	return (0 != XMVector4NotEqual(this->m_vec, rhs.m_vec));
}


///
void vector4::operator *=(scalar s)
{
	this->m_vec = XMVectorScale(this->m_vec, s);
}


///
void vector4::operator -=(const vector4 & rhs)
{
	this->m_vec = XMVectorSubtract(this->m_vec, rhs.m_vec);
}


///
void vector4::operator +=(const vector4 & rhs)
{
	this->m_vec = XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
vector4 vector4::operator *(scalar s) const
{
	return XMVectorScale(this->m_vec, s);
}


///
vector4 vector4::operator +(const Math::vector4 &rhs) const
{
	return XMVectorAdd(this->m_vec, rhs.m_vec);
}


///
vector4 vector4::operator -(const Math::vector4 &rhs) const
{
	return XMVectorSubtract(this->m_vec, rhs.m_vec);
}


///
vector4 vector4::operator -() const
{
	return XMVectorNegate(this->m_vec);
}





///
void vector4::set(scalar x, scalar y, scalar z, scalar w)
{
	this->m_vec = XMVectorSet(x,y,z,w);
}





///
vector4 vector4::nullvec()
{
	return XMVectorSet(0.0f,0.0f,0.0f,0.0f);
}


///
vector4 vector4::upvec()
{
	return XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);
}


}

#endif // RE_USE_DX